home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Viewers / aa_m68k_Intel_Only / ToyViewer1.2 / Source / gif.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-12  |  1.6 KB  |  51 lines

  1. /*
  2.     gif.h
  3.  
  4.     gifheader.c, gifbmap.c, and gif.h are based on "giftoppm"
  5.     of David Koblas.
  6.     They are modified by T. Ogihara. (1995)
  7. */
  8.  
  9. /* +-------------------------------------------------------------------+ */
  10. /* | Copyright 1990, David Koblas.                                     | */
  11. /* |   Permission to use, copy, modify, and distribute this software   | */
  12. /* |   and its documentation for any purpose and without fee is hereby | */
  13. /* |   granted, provided that the above copyright notice appear in all | */
  14. /* |   copies and that both that copyright notice and this permission  | */
  15. /* |   notice appear in supporting documentation.  This software is    | */
  16. /* |   provided "as is" without express or implied warranty.           | */
  17. /* +-------------------------------------------------------------------+ */
  18.  
  19. #include  <stdio.h>
  20. #include  <libc.h>
  21. #include  <objc/objc.h>
  22. #include  "common.h"
  23.  
  24. #define INTERLACE        0x40
  25. #define LOCALCOLORMAP        0x80
  26. #define BitSet(byte, bit)    (((byte) & (bit)) == (bit))
  27. #define    ReadOK(file,buffer,len)    (fread(buffer, len, 1, file) != 0)
  28.  
  29. typedef struct {
  30.     unsigned int    width;
  31.     unsigned int    height;
  32.     unsigned int    colors;
  33.     unsigned short    Resolution;
  34.     unsigned short    Background;
  35.     unsigned short    AspectRatio;
  36.     BOOL        colormap;
  37.     BOOL        interlace;
  38.     char        ver[4];
  39.     paltype        *palette;
  40.     unsigned char    *memo;
  41. } gifHeader;
  42.  
  43. gifHeader *loadGifHeader(FILE *fd, int *errcode);
  44. void freeGifHeader(gifHeader *gh);
  45. commonInfo *gifInfo(gifHeader *, int, BOOL);
  46.  
  47. int gifGetImage(FILE *, gifHeader *, int *, unsigned char **);
  48. int GetDataBlock(FILE *, unsigned char *);
  49. int initGifLZW(FILE *);
  50. int LWZReadByte(FILE *);
  51.